package com.anlu.concurrent.ch5.bq;

import java.util.concurrent.DelayQueue;

/**
 * <p>
 * Description:TODO 详细描述
 * <p>
 * Copyright: 天津联想协同科技有限公司
 * <p>
 *
 * @author anlu
 * @date 2021/10/27 16:44
 */
public class Test {
    public static void main(String[] args)throws InterruptedException {
        DelayQueue<ItemVo<Order>> queue = new DelayQueue<>();

        // 放入订单
        new Thread(new PutOrder(queue)).start();
        // 取出订单
        new Thread(new FetchOrder(queue)).start();

        for (int i = 0; i < 15; i++) {
            Thread.sleep(500);
            System.out.println(i*500);
        }
    }
}
